//if(innerLayout.state.south.isClosed === true) innerLayout.toggle('south');
$.fn.showLoading = function(){
	$(this).html('<div align="center"><img src="images/loading.gif"><br /><strong>Loading</strong></div>');
}

$(function(){
	$(".cargo").click(function(){
		loadPage('#contentright','cargo.php');		
		loadPage('#sidebar','cargo.sidebar.php');
		if(Layout.state.west.isClosed === true) Layout.toggle('west');
	});
	$(".manage_accounts").click(function(){
		loadPage('#contentright','accounts.php');
		loadPage('#sidebar','accounts.sidebar.php');
		if(Layout.state.west.isClosed === true) Layout.toggle('west');
	});
	
	$(".reports").click(function(){
		loadPage('#contentright','reports.php');
		loadPage('#sidebar','reports.sidebar.php');
		if(Layout.state.west.isClosed === true) Layout.toggle('west');
	});
	
	$(".header_userinfo").click(function(){
		loadPage('#contentright','myaccount.php');
		loadPage('#sidebar','myaccount.sidebar.php');
	});
	
});



function loadPage(element,file){	
	$(element).html('<img src="images/loading.gif"><br /><strong>Loading</strong>');
	//$(element).hide('fast'); 
	$(element).load(file,function(){$(element).show('slow')});
}